<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="单表范例列表">
</@header>
<@search fromId="test-form">
<div class="select-list">
<ul>
                            <li>
                                 <label><@ctx.i18n text = "name"/>： </label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                 <label><@ctx.i18n text = "email"/>： </label>
                                <input type="text" name="email"/>
                            </li>
                            <li>
                                 <label><@ctx.i18n text = "age"/>： </label>
                                <input type="text" name="age"/>
                            </li>
                            <li>
                                 <label><@ctx.i18n text = "性别"/>： </label>
                                <select name="sex" class="form-control">
                                    <option value=""><@ctx.i18n text = "所有"/></option>
                                <#list dict.getType('sys_user_sex')>
                                    <#items as d>
                                        <#if d.status =='0' >
                                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                                        </#if>
                                    </#items>
                                </#list>
                                </select>
                            </li>
                            <li class="select-time">
                                  <label> <@ctx.i18n text = "出生日期"/>：</label>
                                <input type="text" class="time-input" placeholder="" name="Birthday"/>                              
                            </li>
                                     <li class="select-time">
                                  <label> <@ctx.i18n text = "离职日期"/>：</label>
                                <input type="text" class="time-input" placeholder="" name="LeaveDate"/>                              
                            </li>
                                     <li>
                                 <label><@ctx.i18n text = "员工编号"/>： </label>
                                <input type="text" name="pin"/>
                            </li>
                            <li>
                                 <label><@ctx.i18n text = "职位"/>： </label>
                                <select name="position" class="form-control">
                                    <option value=""><@ctx.i18n text = "所有"/></option>
                                <#list dict.getType('sys_post_type')>
                                    <#items as d>
                                        <#if d.status =='0' >
                                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                                        </#if>
                                    </#items>
                                </#list>
                                </select>
                            </li>
                            <li class="select-time">
                                  <label> <@ctx.i18n text = "入职日期"/>：</label>
                                <input type="text" class="time-input" placeholder="" name="JoinDate"/>                              
                            </li>
                                     <li>
                                 <label><@ctx.i18n text = "身份证号"/>： </label>
                                <input type="text" name="noationalId"/>
                            </li>
                            <li>
                                 <label><@ctx.i18n text = "education"/>： </label>
                                <select name="education" class="form-control">
                                    <option value=""><@ctx.i18n text = "所有"/></option>
                                <#list dict.getType('sys_post_type')>
                                    <#items as d>
                                        <#if d.status =='0' >
                                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                                        </#if>
                                    </#items>
                                </#list>
                                </select>
                            </li>
    <li>
        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
        <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
    </li>
    </ul>
    </div>
</@search>
<@table tableId="bootstrap-table">

    <@shiro.hasPermission name="gen:test:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="gen:test:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="gen:test:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
        </a>
    </@shiro.hasPermission>


</@table>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("gen:test:edit")}";
    var listFlag = "${permission.hasPermi("gen:test:add")}";
    var delFlag = "${permission.hasPermi("gen:test:del")}";
    var visible = ${permission.isPermitteds("gen:test:edit,gen:test:del,gen:test:add")?string('true', 'false')};
                                                    var sexDatas = ${dict.getDictListJson('sys_user_sex')};
                                        var delFlagDatas = ${dict.getDictListJson('sys_status')};
                                                        var positionDatas = ${dict.getDictListJson('sys_post_type')};
                var hobbyDatas = ${dict.getDictListJson('sys_post_type')};
                                var educationDatas = ${dict.getDictListJson('sys_post_type')};
            var prefix = baseURL + "gen/test";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "单表范例",
            uniqueId:  'id'                                       , /* 唯一ID */            
            escape: true,         /* 分页设置 */
            showPageGo: true,   /* 分页设置 */
            pageSize: 10,    /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            
            columns: [{
                title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            }
            ,{
                    field : 'id'
                    ,title : '<@ctx.i18n text = "id"/>'
                    ,visible: false
                }
                 ,{
                    field : 'name'
                    ,title : '<@ctx.i18n text = "name"/>'
   ,sortable: true                }
                  ,{
                    field : 'pin'
                    ,title : '<@ctx.i18n text = "员工编号"/>'
   ,sortable: true                }
                     ,{
                    field : 'email'
                    ,title : '<@ctx.i18n text = "email"/>'
                }
                ,{
                    field : 'phone'
                    ,title : '<@ctx.i18n text = "电话"/>'
                }
                ,{
                    field : 'age'
                    ,title : '<@ctx.i18n text = "age"/>'
                }
                ,{
                    field : 'sex'
                    ,title : '<@ctx.i18n text = "性别"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabels(sexDatas, value);
                    }
                }
                ,{
                    field : 'birthday'
                    ,title : '<@ctx.i18n text = "出生日期"/>'
                }
                                                       ,{
                    field : 'position'
                    ,title : '<@ctx.i18n text = "职位"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabels(positionDatas, value);
                    }
                }
              ,{
                    field : 'education'
                    ,title : '<@ctx.i18n text = "education"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabels(educationDatas, value);
                    }
                }
                   ,{
                    field : 'hobby'
                    ,title : '<@ctx.i18n text = "爱好"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabels(hobbyDatas, value);
                    }
                }
                  ,{
                    field : 'leaveDate'
                    ,title : '<@ctx.i18n text = "离职日期"/>'
                }
                 ,{
                    field : 'joinDate'
                    ,title : '<@ctx.i18n text = "入职日期"/>'
                }
                  ,{
                    field : 'noationalId'
                    ,title : '<@ctx.i18n text = "身份证号"/>'
                }
                                    ,{
                    field : 'remark'
                    ,title : '<@ctx.i18n text = "备注信息"/>'
                    ,formatter: function(value, row, index) {        /* 省略显示 */
                               return $.table.tooltip(value,10);
                   }
                }
                ,{
                    title:"<@ctx.i18n text = "操作"/>"
                    ,align: 'center'
                    ,visible:visible
                    ,class:'action'
                    ,formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="' + editFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "编辑"/>" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i></a> ');
                        actions.push('<a class="' + delFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "删除"/>" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></a> ');
                        return actions.join('');
                    }
                }
                ]
            };
            $.table.init(options);
        });

</script>
</@footer>
</@pageTheme>